import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: mirac
 * Date: 2025-07-20
 * Time: 13:46
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        s = s.toUpperCase();
        boolean ans = func(s);
        System.out.println(ans);
    }

    public static boolean judChar(char ch) {
        if((ch >= 'A'&&ch <= 'Z')||(ch >= '0'&&ch <= '9')) {
            return true;
        }
        return false;
    }

    public static boolean func(String s) {
        int left = 0,right = s.length()-1;
        while(left < right) {
            while(left < right&&!judChar(s.charAt(left))) {
                left++;
            }

            while(left < right&&!judChar(s.charAt(right))) {
                right--;
            }
            if(s.charAt(left) != s.charAt(right)) {
                return false;
            } else {
                left++;
                right--;
            }
        }
        return true;
    }
}
